// Ninf-G-XX, ver. 0.1
// Copyright 2011 National Institute of Advanced Industrial Science and Technology
// 
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// 
//     http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
 * RelativeFileProtocol.h
 *
 *  Created on: Feb 4, 2009
 *      Author: nakada
 */

#ifndef RELATIVEFILEPROTOCOL_H_
#define RELATIVEFILEPROTOCOL_H_

#include "Protocol.hh"
#include "HttpProtocol.hh"

class RelativeFileProtocol: public Protocol {
  HttpProtocol httpProtocol;
public:
  RelativeFileProtocol();
  RelativeFileProtocol(const RelativeFileProtocol& protocol);
  ~RelativeFileProtocol();


  virtual void downloadDataFile(const std::string& sourceURI,
                                const Credential& credential);

  virtual void downloadDataFile(const std::string& sourceURI,
                                const std::string& path,
                                const Credential& credential);

  virtual void downloadDataFile(const std::list<std::string>& sourceURIs,
                                const std::list<Credential>& credentials);

  virtual void downloadDataFile(const std::list<std::string>& sourceURIs,
                                const std::string& path,
                                const std::list<Credential>& credentials);

  virtual void downloadDataMemory(const std::string& sourceURI,
                                  void* const dest,
                                  const Credential& credential);

  virtual void downloadDataMemory(const std::string& sourceURI,
                                  void** dest,
                                  size_t* size,
                                  const Credential& credential);

  virtual void downloadDataMemory(const std::list<std::string>& sourceURIs,
                                  void* const dest,
                                  const std::list<Credential>& credentials);

  virtual void downloadDataMemory(const std::list<std::string>& sourceURIs,
                                  void** dest,
                                  size_t* size,
                                  const std::list<Credential>& credentials);

  virtual void uploadDataFile(const std::string& destinationURI,
                              const std::string& path,
                              const Credential& credential);

  virtual void uploadDataMemory(const std::string& destinationURI,
                                void* const src,
                                size_t      src_size,
                                const Credential& credential);
};


#endif /* RELATIVEFILEPROTOCOL_H_ */
